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
html { | |
font: 5vmin/1.3 Serif; | |
overflow: hidden; | |
background: #123; } | |
body, head { | |
display: block; | |
font-size: 52px; | |
color: transparent; } | |
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 { useCallback, useRef, useEffect } from 'react' | |
export function usePromise (promiseFn) { | |
const mountedRef = useRef(false) | |
const isMounted = useCallback(() => mountedRef.current, []) | |
useEffect(() => { | |
mountedRef.current = true | |
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
{ | |
//O client e env ID é para saber sobre que marketplace o ec será cadastrado. | |
client_id: client_id, | |
env_id: env_id, | |
email: email do usuario, | |
password: senha, | |
name: Nome Completo, | |
ein: CPF do Usuário, | |
cellphone: Numero de telefone da empresa ou pessoa fisica, |
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
#!/usr/bin/python3 | |
''' | |
Author: [email protected] | |
Usage: getAllRoutes.py [options] path | |
Options: | |
-h, --help show this help message and exit | |
--quote=QUOTE Quotation marks | |
''' | |
import os, sys | |
import re |
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
var Promise = require("promise-with-queue"), | |
val = 0, position = 0; | |
var loop = (index, callback) => { | |
setTimeout(() => { | |
val += index * 10; | |
console.log("loop | index:", index, "val:", val) | |
++position; | |
callback(val) | |
}, Math.floor(Math.random() * (500 - 2000) + 500)) |
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
alias mongorestart="sudo rm /var/lib/mongodb/mongod.lock && sudo service mongod restart" | |
alias bashrc="source ~/.bashrc" | |
gitall(){ | |
if [ -z "$1" ]; then | |
git add --all && git commit -m all && git push origin master | |
else | |
git add --all && git commit -m \"$1\" && git push origin master | |
fi | |
} |
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
var path = require('path'), | |
evh = require('express-vhost'), | |
express = require('express'), | |
server = express(); | |
/** | |
* express-vhost | |
**/ | |
server.use(evh.vhost(server.enabled('trust proxy'))); | |
server.listen(3000); //port 3000 |
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 | |
LD_PRELOAD=/lib/x86_64-linux-gnu/libresolv.so.2 /opt/Unity/Editor/Unity |
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
using UnityEngine; | |
using System.Collections; | |
public static class SpritePivotAlignment | |
{ | |
public static SpriteAlignment GetSpriteAlignment(GameObject SpriteObject) | |
{ | |
BoxCollider2D MyBoxCollider = SpriteObject.AddComponent<BoxCollider2D>(); | |
float colX = MyBoxCollider.offset.x; | |
float colY = MyBoxCollider.offset.y; |
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
using UnityEngine; | |
using System.Collections; | |
[RequireComponent(typeof(SpriteRenderer))] | |
public class RepeatSpriteBoundary : MonoBehaviour | |
{ | |
SpriteRenderer sprite; | |
void Awake() | |
{ |
NewerOlder