This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
const RFor = ({ data, renderItem }) => { | |
return data.map((item) => renderItem(item)); | |
}; | |
const data = ["i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "i10"]; | |
const Box = ({ item }) => ( | |
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Loop = () => { | |
const animals = [ | |
{ id: 1, animal: "Dog" }, | |
{ id: 2, animal: "Bird" }, | |
{ id: 3, animal: "Cat" }, | |
{ id: 4, animal: "Mouse" }, | |
{ id: 5, animal: "Horse" }, | |
]; | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get update | |
echo "# install dependencies" | |
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common | |
echo "# add the gpg key for docker" | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.clear(); | |
// People dropping off a form (Action Creators) | |
const createPolicy = (name, amount) => { | |
return { // Action (a form in our analogy) | |
type: 'CREATE_POLICY', | |
payload: { | |
name: name, | |
amount: amount | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set oLocator = CreateObject("WbemScripting.SWbemLocator") | |
set oServices = oLocator.ConnectServer(".","root\wmi") | |
set oResults = oServices.ExecQuery("select * from batteryfullchargedcapacity") | |
for each oResult in oResults | |
iFull = oResult.FullChargedCapacity | |
next | |
while (1) | |
set oResults = oServices.ExecQuery("select * from batterystatus") | |
for each oResult in oResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SinglyLinkedListNode { | |
constructor(data, next = null) { | |
this.data = data; // piece of data | |
this.next = next; //reference to next node | |
} | |
} | |
class SinglyLinkedList { | |
constructor() { | |
this.head = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true | |
do | |
export DISPLAY=:0.0 | |
battery_level=`cat /sys/class/power_supply/BAT0/capacity` | |
if [ $(cat /sys/class/power_supply/BAT0/status) = 'Charging' ]; then | |
if [ $battery_level -ge 80 ]; then | |
notify-send -t 10000 "Battery Full" "Level: ${battery_level}%" | |
fi | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Label, FormGroup, Input, Row, Col } from "reactstrap"; | |
import { Delete, Plus } from "react-feather"; | |
export default class FormRepeater extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
value: "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
from PIL import Image | |
path = sys.argv[1] | |
directory = sys.argv[2] | |
if not os.path.exists(directory): | |
os.makedirs(directory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PyPDF2 import PdfFileMerger | |
inputs = sys.argv[1:] | |
def pdf_combiner(pdf_list): | |
merger = PdfFileMerger() | |
for pdf in pdf_list: | |
print(pdf) |
OlderNewer