Skip to content

Instantly share code, notes, and snippets.

View derekbar90's full-sized avatar
🚀

Derek Barrera derekbar90

🚀
View GitHub Profile
@derekbar90
derekbar90 / attestation.txt
Created April 11, 2022 21:19
Attestation
I contributed to the Semaphore Trusted Setup Multi-Party Ceremony.
The following are my contribution signatures:
Circuit: semaphore16
Contributor # 277
Hash: c24eb2f8 2a189e21 84caf37c df56174c
47ee2a5c 8953d361 55ccd5cf d5673035
be02c244 9cc257fa 730370c6 4401e082
c52ec86e 2d95424b b1e1af6a fee249ef
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"description","type":"string"}],"name":"LogNewProvableQuery","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"ethv","type":"string"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Publish","type":"event"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"string","name":"curr_ethv","type":"string"}],"name":"__callback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_myid","type":"bytes32"},{"internalType":"string","name":"_result","type":"string"},{"internalType":"bytes","name":"_proof","type":"bytes"}],"name":"__callback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ethv","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMut

Increasing the amount of inotify watchers

If you are not interested in the technical details and only want to get Listen to work:

  • If you are running Debian, RedHat, or another similar Linux distribution, run the following in a terminal:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@derekbar90
derekbar90 / sitemap.xml.ts
Created July 6, 2020 18:42
NextJS Dynamic Sitemap
import { NextApiRequest, NextApiResponse } from 'next';
import { SitemapStream, streamToPromise, EnumChangefreq } from 'sitemap';
import { createGzip } from 'zlib';
import { readdir } from 'fs';
import { promisify } from 'util';
const asyncReaddir = promisify(readdir);
export default async (req: NextApiRequest, res: NextApiResponse) => {
import React, { useEffect, useRef } from "react";
import {
Animated,
Dimensions,
Image,
StyleSheet,
Text,
TouchableOpacity,
} from "react-native";
import Config from "react-native-config";
echo "Fixing React Native third party folder"
rm -rf ~/.rncache
cd node_modules/react-native
rm -fr third-party
scripts/ios-install-third-party.sh
cd third-party/glog-0.3.4/
../../scripts/ios-configure-glog.sh
cd ../../../../
echo "Fixing Missing libfishhook.a"
curl -o node_modules/react-native/Libraries/WebSocket/libfishhook.a http://cloud.derekbarrera.com/BiTmZ2o8z9RuPLpjN4t1/libfishhook.a

Keybase proof

I hereby claim:

  • I am derekbar90 on github.
  • I am derekbarrera (https://keybase.io/derekbarrera) on keybase.
  • I have a public key ASBX6hQwvS3wcv2bLCbH1fov7wStr0e-Y6H5vUD4b7A4wwo

To claim this, I am signing this object:

@derekbar90
derekbar90 / GetDate
Created November 4, 2014 18:32
getDate method
private String getDate(){
SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd");
Date today = new Date();
return date.format(today);
}
@derekbar90
derekbar90 / gist:73d6cc8a06ae5d83c763
Last active August 29, 2015 14:07
RegEx example
private String regex(String string){
String result = "";
String patternString = "[0-9][0-9]:[0-9][0-9]:[0-9][0-9]";
Pattern pattern = Pattern.compile(patternString);
Matcher matches = pattern.matcher(string);
while(matches.find()){
@derekbar90
derekbar90 / Twilio Formatted Date String
Created October 13, 2014 16:37
Twilio Formatted Date String
public String setTimeStamp(){
SimpleDateFormat date = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
Date today = new Date();
currentDateStamp = date.format(today);
return currentDateStamp;
}