Skip to content

Instantly share code, notes, and snippets.

View a7ul's full-sized avatar
🚀

Atul R a7ul

🚀
View GitHub Profile
@a7ul
a7ul / reset.css
Created December 16, 2017 07:49
A reset.css for projects using css modules [helpful for react apps] (webpack css-loader with modules: true)
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
:global(html), :global(body), :global(div), :global(span), :global(applet), :global(object), :global(iframe),
:global(h1), :global(h2), :global(h3), :global(h4), :global(h5), :global(h6), :global(p), :global(blockquote), :global(pre),
:global(a), :global(abbr), :global(acronym), :global(address), :global(big), :global(cite), :global(code),
:global(del), :global(dfn), :global(em), :global(img), :global(ins), :global(kbd), :global(q), :global(s), :global(samp),
:global(small), :global(strike), :global(strong), :global(sub), :global(sup), :global(tt), :global(var),
:global(b), :global(u), :global(i), :global(center),
@a7ul
a7ul / jamf.md
Last active September 23, 2024 16:25
removing all restrictions on jamf managed macos device - Provided you have root access.

REMOVE JAMF RESTRICTIONS ON MAC

REMOVE ONLY RESTRICTIONS

sudo jamf removeMDMProfile removes all restrictions

sudo jamf manage brings back all restrictions and profiles

REMOVE ALL RESTRICTIONS AND DISABLE JAMF BINARIES WHILE KEEPING YOUR ACCESS TO VPN AND OTHER SERVICES

sudo jamf removeMDMProfile removes all restrictions

@a7ul
a7ul / webpack.config.js
Created January 21, 2018 11:19
Webpack config for electron + react apps
const path = require('path');
module.exports = {
entry: path.resolve(__dirname, '../index.js'),
output: {
path: path.resolve(__dirname, '../build'),
filename: 'bundle.js'
},
devtool: 'eval',
devServer: {
@a7ul
a7ul / launchTerminal.js
Last active March 24, 2020 04:18
Launch a command in new terminal - just like react native's metro bundler . This snippet is inspired from react-native source code
const path = require('path');
const childProcess = require('child_process');
const process = require('process');
const shelljs = require('shelljs');
const startServerInNewWindow = () => {
const scriptFile = /^win/.test(process.platform) ?
'startCommand.bat' :
'startCommand.command';
@a7ul
a7ul / .gitignore
Last active June 13, 2018 07:09
blog-addons-first
node_modules
*.log
build
@a7ul
a7ul / index.js
Last active June 13, 2018 07:18
blog-on-node-addons-second
//index.js
const testAddon = require('./build/Release/testaddon.node');
module.exports = testAddon;
@a7ul
a7ul / function.diff
Last active June 13, 2018 08:59
blog-on-node-addon-third
diff --git a/binding.gyp b/binding.gyp
index 23b9976..2d188af 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -4,7 +4,8 @@
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"sources": [
- "cppsrc/main.cpp"
+ "cppsrc/main.cpp",
@a7ul
a7ul / add_function.diff
Created June 13, 2018 10:38
blog-on-node-addon-function-with-params
diff --git a/cppsrc/Samples/functionexample.cpp b/cppsrc/Samples/functionexample.cpp
index 0bd9bc2..37b7eb9 100644
--- a/cppsrc/Samples/functionexample.cpp
+++ b/cppsrc/Samples/functionexample.cpp
@@ -4,13 +4,33 @@ std::string functionexample::hello(){
return "Hello World";
}
+int functionexample::add(int a, int b){
+ return a + b;
@a7ul
a7ul / actualclass.cpp
Created June 15, 2018 09:18
blog-on-node-addon-class
/* cppsrc/Samples/actualclass.cpp */
#include "actualclass.h"
ActualClass::ActualClass(double value){
this->value_ = value;
}
double ActualClass::getValue()
{
@a7ul
a7ul / classexample.cpp
Last active August 18, 2019 09:55
blog-on-node-addon-class-wrapper
/* cppsrc/Samples/classexample.cpp */
#include "classexample.h"
Napi::FunctionReference ClassExample::constructor;
Napi::Object ClassExample::Init(Napi::Env env, Napi::Object exports) {
Napi::HandleScope scope(env);
Napi::Function func = DefineClass(env, "ClassExample", {