Skip to content

Instantly share code, notes, and snippets.

View ndastur's full-sized avatar

Neville Dastur ndastur

  • Clinical Software Solutions
View GitHub Profile
@ptrstpp950
ptrstpp950 / preRequestScript.js
Last active April 18, 2024 21:10
Calculate TOTP in Postman
//Article about TOTP on my blog https://stapp.space/generate-totp-in-postman/
/**
* @preserve A JavaScript implementation of the SHA family of hashes, as
* defined in FIPS PUB 180-4 and FIPS PUB 202, as well as the corresponding
* HMAC implementation as defined in FIPS PUB 198a
*
* Copyright Brian Turek 2008-2017
* Distributed under the BSD License
* See http://caligatio.github.com/jsSHA/ for more information
@ErikAugust
ErikAugust / spectre.c
Last active May 22, 2024 23:07
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@c0mm4nDer
c0mm4nDer / Notification.cs
Created October 8, 2017 16:19
One Signal ClearOneSignalNotifications For Xamarin.Android
/* All xamarin programmers know that binding libraries is not always done correctly.
One of these libraries is OneSignal. In OneSignal plugin, there is a method called "ClearOneSignalNotifications"
that clears all notifications displayed.
This method is not included in the binding provided for xamarin.For Fix this we should rewrite this method.
You can see original code of this method in [OneSignal SDK Android](https://github.com/OneSignal/OneSignal-Android-SDK/blob/b1c01e0404b3f39d433f48abfa79c99e2af1f6f0/OneSignalSDK/onesignal/src/main/java/com/onesignal/OneSignal.java).
I used ADO for connect to sqlite but you can rewrite it by any kind of sqlite connection. I hope this code can help you.*/
using Android.App;
using Android.Content;
using Mono.Data.Sqlite;
@ivy
ivy / API.txt
Created July 3, 2017 19:21
Claymore JSON-RPC API documentation (from Claymore v9.6)
EthMan uses raw TCP/IP connections (not HTTP) for remote management and statistics. Optionally, "psw" field is added to requests is the password for remote management is set for miner.
The following commands are available (JSON format):
----------------
REQUEST:
{"id":0,"jsonrpc":"2.0","method":"miner_getstat1"}
RESPONSE:
{"result": ["9.3 - ETH", "21", "182724;51;0", "30502;30457;30297;30481;30479;30505", "0;0;0", "off;off;off;off;off;off", "53;71;57;67;61;72;55;70;59;71;61;70", "eth-eu1.nanopool.org:9999", "0;0;0;0"]}
@paulsturgess
paulsturgess / service.js
Last active February 2, 2024 17:24
An example Service class wrapper for Axios
import axios from 'axios';
class Service {
constructor() {
let service = axios.create({
headers: {csrf: 'token'}
});
service.interceptors.response.use(this.handleSuccess, this.handleError);
this.service = service;
}
@johnantoni
johnantoni / gist:07df65898456ace4307d5bb6cbdc7f51
Last active April 3, 2022 16:31 — forked from mgmilcher/gist:5eaed7714d031a12ed97
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

@linakis
linakis / generate-ios-screenshots.sh
Created April 15, 2016 11:50
Imagemagick bash script to generate portrait iOS app store screenshots from 6+ input
#!/bin/sh
# Generate iPhone Portrait Screenshots from 6+ for app store submission.
# From folder containing 6+ screenshots do:
# ./generate-ios-screenshots.sh *.png
mkdir -p 3.5
mkdir -p 4.0
mkdir -p 4.7
mkdir -p 5.5
@Lerg
Lerg / prepare_icons.sh
Last active April 11, 2024 19:25
Make all app icons with imagemagick, iOS and Android
#!/bin/sh
base=$1
convert "$base" -resize '29x29' -unsharp 1x4 "Icon-Small.png"
convert "$base" -resize '40x40' -unsharp 1x4 "Icon-Small-40.png"
convert "$base" -resize '50x50' -unsharp 1x4 "Icon-Small-50.png"
convert "$base" -resize '57x57' -unsharp 1x4 "Icon.png"
convert "$base" -resize '58x58' -unsharp 1x4 "Icon-Small@2x.png"
convert "$base" -resize '60x60' -unsharp 1x4 "Icon-60.png"
convert "$base" -resize '72x72' -unsharp 1x4 "Icon-72.png"
convert "$base" -resize '76x76' -unsharp 1x4 "Icon-76.png"
@ricardoalcocer
ricardoalcocer / makefile
Created December 6, 2013 17:49
Makefile to build and test native Android modules for Titanium
#
# make file for building, packaging and testing native android modules for titanium
# originally written by Tomas Hau (@mudderman) and modified by Ricardo Alcocer (@ricardoalcocer)
#
# 1. create a folder to hold your module and your test Ti app. this file lives here
# 2. create two sub-folders: 'mod' and 'testapp'
# 3. set the MODULE_NAME, MODULE_VERSION and APP_NAME variables to match your app ids
#
# to build simply run 'make full', 'make app' or 'make module'
#
@jimothyGator
jimothyGator / README.md
Last active April 25, 2024 18:00
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/