Skip to content

Instantly share code, notes, and snippets.

View basarat's full-sized avatar
🌹
youtube.com/basaratali

Basarat Ali Syed basarat

🌹
youtube.com/basaratali
View GitHub Profile
extend({foo:123},b());
function b(){
return [
{foo:123},
{bar:456}
];
}
extend({foo:123},b());
function b(){
return extend(
{foo:123},
{bar:456}
);
}
export function extend(...args: any[]):any {
let extractFields = obj => {
for (let key in obj) {
//copy all the fields
newObj[key] = obj[key];
}
}
var extendRecursive = (x:any[]) => {
for (let obj of x) {
function test({ x, y }: { x: number, y: number }) {
console.log(x, y);
}
test({
x: 1,
y: 2
});
function test({ x:xLocal, y:yLocal }) {
console.log(xLocal, yLocal);
}
const foo = 123;
const bar = {
bas : 123, // Why not `bas = 123`
};
function test({ x = 123, y = 456 }: { x?: number, y?: number } = {}) {
console.log(x, y);
}
test({
x: 1,
y: 2
});
/**
* Lays out a job with a job form in a scrollable region
* with the footer pinned to the bottom
*/
@ui.Radium
export class LayoutJob extends React.Component<{
content:JSX.Element,
footer:JSX.Element,
},{}>{
private styles = {
export function padding(a: any, b?: any, c?: any, d?: any) {
if (!b && !c && !d) {
b = c = d = a;
}
else if (!c && !d) {
c = a;
d = b;
}
return {
paddingTop: _toString(a),
type PaddingUnit = number | string;
export function padding(a: PaddingUnit, b?: PaddingUnit, c?: PaddingUnit, d?: PaddingUnit) {
if (!b && !c && !d) {
b = c = d = a;
}
else if (!c && !d) {
c = a;
d = b;
}
return {