Skip to content

Instantly share code, notes, and snippets.

View arshad115's full-sized avatar
🏋️‍♂️
Working on my Android app and a PWA in Vue.js

Arshad Mehmood arshad115

🏋️‍♂️
Working on my Android app and a PWA in Vue.js
View GitHub Profile
@greghelton
greghelton / cookbook.sql
Created January 1, 2012 06:41
MySQL Database for Cookbook, Recipes, Ingredients
-- start the server: $ mysqld --console
-- login: $ mysql -u root --password=wxyz
-- run the script: mysql> source /Users/javapro/dev/src/sql/Cookbook.sql
-- the script:
drop database if exists Cookbook;
create database Cookbook;
connect Cookbook;
@bwhite
bwhite / rank_metrics.py
Created September 15, 2012 03:23
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
@fannix
fannix / text_to_libsvm.py
Created November 17, 2012 01:07
Convert text format to libsvm format
""" project text to libsvm vector space
"""
from gensim import corpora, models, similarities
import sys
import os.path
def load_document():
text_li = []
for line in sys.stdin:
@prime31
prime31 / gist:5675017
Last active May 28, 2024 11:37
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
create new rails app:
$ rails new store_name -d postgresql
in postgres:
$ psql -U postgres
$ create role store_name login createdb;
create databases:
@mblondel
mblondel / letor_metrics.py
Last active April 24, 2024 19:43
Learning to rank metrics.
# (C) Mathieu Blondel, November 2013
# License: BSD 3 clause
import numpy as np
def ranking_precision_score(y_true, y_score, k=10):
"""Precision at rank k
Parameters
@kevincolten
kevincolten / post.md
Last active October 24, 2023 00:11
@post Hosting Multiple Repositories With GitHub Pages

GitHub Pages is great for building a personal or project website. It'll default to http://username.github.io, or you can even use your own custom domain name from services like Namecheap, which I will write about in another post soon.

So you set up your GitHub Page for yourself or project, but what if you want to show off some of your other projects you are working on. You can go the poor man's route, and simply just copy everything from another repository into a folder in your username.github.io repository, commit and push the changes to GitHub, and you'll be able to navigate to http://username.github.io/project.

But this comes with some seriously inconvienent and non-conventional drawbacks, such as duplication of code across repositories and manually copy/paste-ing everytime changes are made to update your hosted codebase. Good luck maintaining that.

The other

@paulocaldeira17
paulocaldeira17 / AppBarStateChangeListener.java
Last active December 21, 2023 09:50
Android AppBarLayout collapsed/expanded state listener
import android.support.design.widget.AppBarLayout;
/**
* App bar collapsing state
* @author Paulo Caldeira <paulo.caldeira@acin.pt>.
*/
public abstract class AppBarStateChangeListener implements AppBarLayout.OnOffsetChangedListener {
// State
public enum State {
EXPANDED,
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Last active May 28, 2024 11:37
firebase notification sample in php . if you like this code follow me and star it . i will follow you and use your codes and share them . Simple PHP FireBase (FCM) script showing how to send an Android push notification. Be sure to replace the SERVER_API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',
@CodeMyUI
CodeMyUI / index.html
Created January 30, 2017 00:43
Ken Burns effect - pure css
<div class="image-wrap">
<img src="https://unsplash.it/900/700">
</div>