Skip to content

Instantly share code, notes, and snippets.

View xrepzm's full-sized avatar

Nandor Dudas xrepzm

  • Debrecen, Hungary
View GitHub Profile
@Maras0830
Maras0830 / project.dev.conf
Created March 15, 2017 09:33
[nginx] same domain map to different project. [Vuex(vue-route) + Laravel]
server {
listen 80;
listen [::]:80;
server_name test.dev;
root /var/www/project1/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
@simenbrekken
simenbrekken / schema.js
Created December 21, 2016 14:06
Firebase backed GraphQL schema
import firebase from 'firebase'
import { filter, map } from 'lodash'
import { makeExecutableSchema } from 'graphql-tools'
firebase.initializeApp({
databaseURL: 'https://grafire-b1b6e.firebaseio.com',
})
const mapSnapshotToEntity = snapshot => ({ id: snapshot.key, ...snapshot.val() })
const mapSnapshotToEntities = snapshot => map(snapshot.val(), (value, id) => ({ id, ...value }))
@dtipson
dtipson / workerFactory.js
Last active March 15, 2020 15:39
Template literals allow us to write string code suitable for workers. We can even import actual functions using toString. Blob urls allow us to turn all that content into a script for the worker to run, allowing us to create and run one with no external dependencies!
//actual function (must be a named function declaration for use w/ toString here)
function addOne(x){ return x+1 };
//the actual worker code can be written as a string
//template literals make that convienient because they support multiline
//note that the addOne function above can be used in this worker code, since we'll be importing it
const workerScript = `
self.addEventListener('message', function(e) {
var data = e.data;
console.log('worker recieved: ',data);
function loadMeatOf(name, list) {
var deferred = Promise.defer();
http.get('http://localhost:8080/meta/' + name, function(response) {
var responseBody = ""; // will hold the response body as it comes
// join the data chuncks as they come
response.on('data', function(chunck) { responseBody += chunck });
@milon
milon / Controller.php
Last active November 27, 2023 18:32
Delete Modal Popup with Laravel, Bootstrap and jQuery
public function index(){
$categoryList = Category::all();
return view('category.list')->with('categoryList', $categoryList);
}
@hofmannsven
hofmannsven / README.md
Last active February 24, 2026 02:03
Git CLI Cheatsheet