This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#define ORGINAL_FILE "/root/original_file" | |
#define DUPLICATE_FILE "/root/deplicate_file" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <sys/un.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
/* Function to write the data to the socket */ | |
int write_socket (int socket_fd, const char* text) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contact [] delContact = [SELECT Id FROM Contact where LastName = 'YLast']; | |
delete delContact; | |
System.debug(delContact); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Testhandler { | |
public static void handleTrigger (Map<Id, Account> newVal) { | |
Set<Decimal> cCode = new set<Decimal> (); | |
Map<Decimal, Reporting_country__c> ctrMap = new Map <Decimal, Reporting_country__c> (); | |
List<Opportunity> listToUpdate = new List<Opportunity> (); | |
for (Account a : newVal.values()) { | |
cCode.add (a.country_code__c); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AddPrimaryContact implements Queueable { | |
Contact cont; | |
String statShort; | |
public AddPrimaryContact (Contact ct, String shortName) { | |
cont = ct; | |
statShort = shortName; | |
} | |
public void execute (QueueableContext queue ) { | |
List<Contact> updateList = new List<Contact> (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page > | |
<!-- Begin Default Content REMOVE THIS --> | |
<h1>Congratulations</h1> | |
This is your new Page: tabbedAccount | |
<!-- End Default Content REMOVE THIS --> | |
<apex:tabPanel switchType="client" selectedTab="name2" id="tabpanel"> | |
<apex:tab label="One" id="tabone" title="Some One" name="name1">Content for tab 1</apex:tab> | |
<apex:tab label="Two" id="tabtwo" title="Some Two" name="name2">Content for tab 2</apex:tab> | |
</apex:tabPanel> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Http http = new Http (); | |
HttpRequest req = new HttpRequest (); | |
req.setEndPoint ('https://th-apex-http-callout.herokuapp.com/animals'); | |
req.setMethod ('POST'); | |
req.setHeader ('Content-Type', 'application/json;charset=UTF-8'); | |
req.setBody ('{"name":"mighty moose _1"}'); | |
HttpResponse response = http.send(req); | |
if (response.getStatusCode() != 201) { | |
System.debug('The status code returned was not expected: ' + | |
response.getStatusCode() + ' ' + response.getStatus()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Facebook Posts Deleter 2016 | |
// @namespace com.vsubhash.js.facebook_posts_deleter.2016 | |
// @description Automatically deletes posts from Activity Log of Facebook, one by one. | |
// @include https://www.facebook.com/*=allactivity | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
document.addEventListener("DOMContentLoaded", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#table-wrapper { | |
position:relative; | |
} | |
#table-scroll { | |
height:150px; | |
overflow:auto; | |
margin-top:20px; | |
} | |
#table-wrapper table { | |
width:100%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun isEmailValid(email: String): Boolean { | |
return Pattern.compile( | |
"^(([\\w-]+\\.)+[\\w-]+|([a-zA-Z]|[\\w-]{2,}))@" | |
+ "((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?" | |
+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\." | |
+ "([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?" | |
+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9]))|" | |
+ "([a-zA-Z]+[\\w-]+\\.)+[a-zA-Z]{2,4})$" | |
).matcher(email).matches() | |
} |