Skip to content

Instantly share code, notes, and snippets.

@joeSaad
joeSaad / CSS-rotations.markdown
Created June 23, 2014 18:10
A Pen by Joe Saad.
@joeSaad
joeSaad / index.html
Created June 24, 2014 20:49
A Pen by Joe Saad.
<svg width="300" height="200">
<polygon points="100,10 40, 129 222, 198 190,198" />
</svg>
@joeSaad
joeSaad / gist:fde88bb3140201a6ad40
Last active August 29, 2015 14:13
Create JSON object from string, string could be a cookie.
var person = "name=Joe;age=34;location=Texas;hobby=soccer";
var ca = person.split(';');
var obj = {};
for (var i= 0; i<ca.length; i++){
var loc = ca[i].indexOf('=');
var p = ca[i].slice(0, loc);
eval("obj." + p + " = '" + ca[i].slice(loc+1) + "'");
}
@joeSaad
joeSaad / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@joeSaad
joeSaad / index.html
Created May 12, 2015 16:01
Putting a table into an array of objects
/*
table>thead(>tr>th{column $}*4)+tbody(>tr*5>td{data $}*4)
*/
<table>
<thead>
<tr>
<th>column 1</th>
<th>column 2</th>
<th>column 3</th>
<th>column 4</th>
<style>
.tech-name span {
border:1px solid #eee;
padding: 4px;
background-color: lightgrey;
border-radius: 2px;
box-shadow: 2px 2px 2px #aaa;
}
.tech-name span:hover {
@joeSaad
joeSaad / gist:1a34b4849cc29493598a9effd86bc6c6
Created May 25, 2016 19:42
Typescript method call from within constructor
export class Place {
currentUser : string;
siteUri: string;
config: string;
static Place.getConfig():string {
return "myID";
};
constructor(config: string){
this.config = this.getConfig();
@joeSaad
joeSaad / .jsx
Created November 1, 2016 18:07
Incrementer Component React
class Form extends React.Component {
constructor(props) {
super(props);
this.state = {value: 0};
this.handleChange = this.handleChange.bind(this);
this.incrementValue = this.incrementValue.bind(this);
this.decrementValue = this.decrementValue.bind(this);
}
handleChange(event) {
#!/bin/bash
# for dealing with all github repos related to npm packages, you basically clone into a directory you name
# install all related npm packages, open your favorite editor for that directory, and run your npm start or whatevever running script you had
# either npm start or npm run dev etc...
git clone $1 $2
cd $2
npm install
sublime .
#!/bin/bash
value=$(<$1)
echo "$value"