Skip to content

Instantly share code, notes, and snippets.

🦋
Trying…

Satyajit Sahoo satya164

🦋
Trying…
Block or report user

Report or block satya164

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View lace.js
"use strict";
function Lace(selector) {
var nodes, el;
// Handle situation where called without "new" keyword
if (false === (this instanceof Lace)) {
return new Lace(selector);
}
@satya164
satya164 / quantity-query.scss
Last active Jul 26, 2017
Quantity Queries in Sass
View quantity-query.scss
@mixin quantity-query($selector, $type, $amount, $max: null) {
@if $type == at-least {
#{$selector}:nth-last-child(n+#{$amount}),
#{$selector}:nth-last-child(n+#{$amount}) ~ #{$selector} { @content; }
} @else if $type == at-most {
#{$selector}:nth-last-child(-n+#{$amount}):first-child,
#{$selector}:nth-last-child(-n+#{$amount}):first-child ~ #{$selector} { @content; }
} @else if $type == between {
@if type-of($max) != "number" {
@error "Max value must be a number for quantity-query.";
@satya164
satya164 / sbc-api-react.sublime-settings
Last active Jun 4, 2017
Sublime Text auto-completions for ReactJS
View sbc-api-react.sublime-settings
// Usage:
// Go to `Sublime Text > Browse Packages`
// Place the file under `User` directory
// Enable the `react` in `sb-setting.sublime-settings` (refer <https://github.com/Pleasurazy/Sublime-Better-Completion/>)
{
"scope": "source.js",
"completions":
[
View react.sublime-completions
// Usage:
// Go to `Sublime Text > Browse Packages`
// Place the file under `User` directory
{
"scope": "source.js",
"completions":
[
// Top-level API
@satya164
satya164 / sbc-api-react-es5.sublime-settings
Last active Sep 15, 2016
Sublime Text auto-completions for ReactJS (ES5)
View sbc-api-react-es5.sublime-settings
// Usage:
// Go to `Sublime Text > Browse Packages`
// Place the file under `User` directory
// Enable the `react-es5` in `sb-setting.sublime-settings` (refer <https://github.com/Pleasurazy/Sublime-Better-Completion/>)
{
"scope": "source.js",
"completions":
[
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@satya164
satya164 / react-native-release.sh
Last active Dec 21, 2015
Release script for React Native (WIP)
View react-native-release.sh
#! /bin/bash
RELEASE="$1"
JAVA_VERSION="1.8"
RED="\033[0;31m"
GREEN="\033[0;32m"
BLUE="\033[0;34m"
ENDCOLOR="\033[0m"
@satya164
satya164 / class-properties-to-methods.js
Created Jan 8, 2016
Codemod to convert class methods to properties, and remove `.bind(this)` in JSX props
View class-properties-to-methods.js
// Codemod to convert class methods to properties, and remove `.bind(this)` in JSX props.
// Doesn't support Flow annotations yet
export default function(file, api) {
const j = api.jscodeshift;
const convertToClassProps = p => {
const node = p.node;
if (node.key.name.indexOf('_') === 0) {
node.type = 'ClassProperty';
View logger.js
/* @flow */
/* eslint-disable no-console */
let _types: ?Array<string>,
_filters: ?Array<string | RegExp>,
_history: ?Array<{ timestamp: number; args: Array<any>; }>;
const labels = {
info: '[info]',
warn: '[warn]',
@satya164
satya164 / MainActivity.java
Last active Dec 2, 2016
react-native-fbsdk in React Native 0.29.+
View MainActivity.java
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "MyApp";
}
You can’t perform that action at this time.